#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableAutoChessHeroRareDao:DaoBase<TableAutoChessHeroRare>
    {
        public override string GetFileName()
        {
            return "TableAutoChessHeroRare.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableAutoChessHeroRare>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableAutoChessHeroRare model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.rare)) UnityEngine.Debug.LogError("数据表id重复:TableAutoChessHeroRare->id: " + model.rare);
            #endif
            cachePrimaryInt[model.rare] = model;
        }
        protected override TableAutoChessHeroRare ParseRowData(string[] rowData)
        {
            TableAutoChessHeroRare data = new TableAutoChessHeroRare();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.rare = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.rareDesc = rowData[1];
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.rareFrameIcon = rowData[2];
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.rareFlagIcon = rowData[3];
            }
            return data;
        }
    }
}
